package com.edu.user.controller;

import com.edu.user.service.ISysRoleService;
import com.edu.vo.PageResultVO;
import com.edu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("manage")
public class SysRoleController {

//    user/roleState
    @Autowired
    private ISysRoleService sysRoleService;

    @ResponseBody
    @RequestMapping("role/roleState")
    public Result queryRoleState(){
        return sysRoleService.queryRole();
    }


    @ResponseBody
    @RequestMapping("role/queryListByPage")
    public PageResultVO queryListByPage(@PathParam("currentPage") Integer currentPage ,
                                        @PathParam("pageSize") Integer pageSize,
                                        @PathParam("name") String name){
        return sysRoleService.queryListByPage(currentPage,pageSize,name);
    }







}
